package com.blockchain.console.servlets.financial.tx;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.console.service.financial.TxglManage;
import com.blockchain.console.service.financial.entity.TxglRecord;
import com.blockchain.console.servlets.financial.AbstractFinancialServlet;
import com.blockchain.framework.http.servlet.annotation.Right;
import com.blockchain.framework.service.ServiceSession;
import com.blockchain.util.parser.IntegerParser;

@Right(id = "C_FINANCE_TXGLVIEW", name = "人民币提现-审核失败-查看原因")
public class TxglView extends AbstractFinancialServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void processGet(HttpServletRequest request,
			HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		processPost(request, response, serviceSession);
	}

	@Override
	protected void processPost(final HttpServletRequest request,
			final HttpServletResponse response,
			final ServiceSession serviceSession) throws Throwable {
		TxglManage extraction = serviceSession.getService(TxglManage.class);
		int id = IntegerParser.parse(request.getParameter("id"));
		TxglRecord txglRecord = extraction.get(id);
		request.setAttribute("txglRecord", txglRecord);
		forwardView(request, response, getClass());
	}
}
